<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib uri="http://displaytag.sf.net" prefix="display"%>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
<head>
	<sx:head cache="false" />
	<link rel="stylesheet" href="/hrs-intranet/styles/displaytag.css" type="text/css" />
	<script type="text/javascript" src="/hrs-intranet/custom/js/calendarFix.js"></script>
</head>

<s:form action="CompensationDaysAction_list" cssClass="formClass"> 

     <sx:autocompleter
        list="employeeList"
        listValue="person.name"
        searchType="startword"
        listKey="id"
        showDownArrow="false"
        keyName="selectedEmployeeId"
        name="selectedEmployeeName"
        label="Employee"
        autoComplete="false"

        />
    
	<s:textfield name="selectedProject" label="Project"  />
	
	<sx:datetimepicker key="selectedDateFrom" label="Date From" displayFormat="dd/MM/yyyy" valueNotifyTopics="/value"/>
	<sx:datetimepicker key="selectedDateTo" label="Date To" displayFormat="dd/MM/yyyy" valueNotifyTopics="/value"/>
	
	    <sx:autocompleter
	        list="employeeList"
	        listValue="person.name"
	        listKey="id"
	        searchType="startword"
	        showDownArrow="false"       
	        keyName="selectedAssignedById"
	        label="Assigned by"
	        autoComplete="false"       
	        name="selectedAssignedByName"
			
	 />

	<script type="text/javascript">
		function clickOK() {
			document.getElementById('okbtn').click();
		}

		function Func1Delay()
		{
			setTimeout("clickOK()", 100);
		}

		function confirmRemove( url ) 
		{
			if ( confirm("Do you confirm to remove the selected compensation day(s)?") )
			{
				document.forms[0].action = url;
		  		document.forms[0].submit();
			}
		}	
	</script>
	 <table width="40%">
  		<tr>
   			<td width="36%" >
   				<div id="btnHolder">
					<s:submit key="Ok" cssClass="btn" id="okbtn" cssStyle="position:relative; left:-97px;"/>
					<input type="reset" name="Cancel" class="btn" style="position:absolute; top:258px; _top:270px; left:413px;" onclick="Func1Delay()">
				</div>
  			 </td>
  		</tr>
 	 </table>
	</s:form>
<s:hidden key="quantity" />
<display:table id="compensationDays" name="listModel" requestURI="CompensationDaysAction_list" class="listable" cellpadding="0" cellspacing="0" pagesize="12">
	<display:column property="assignedTo.person.name" sortable="true" title="Employee"/>
	<display:column property="project" sortable="true" title="Project"/>
	<display:column property="quantity" sortable="true" title="Days"/>
	<display:column property="dateAssigned" sortable="true" title="Date Assigned" format="{0,date,dd/MM/yyyy}"/>
	<display:column property="assignedBy.person.name" sortable="true" title="Assigned By"/>
	<display:column property="notes" sortable="true" title="Notes" />
	<s:if test="hasPermission(permissionNameConverter.getDeleteCompDayPermission())" >
		<s:url id="remove_action" action="DeleteCompensationDaysAction_validateDelete"  />
    	<display:column title="Options">
   	   		<a href="javascript:confirmRemove('${remove_action}?requestId=${compensationDays.id}')">Delete</a>
    	</display:column>  
    </s:if>
	
</display:table>
